<?php

namespace Beerus\Modules\BasicSetting\Controllers;

use App\Http\Controllers\Controller;
use Beerus\Modules\BasicSetting\Actions\OperatorTransferBatch;
use Biz\tools\FileUpload;
use Doraemon\service\position\UserProfileModule\Area;
use Illuminate\Http\Request;
use Biz\pockets\excel\DownExcel;

class AreaController extends Controller {

    public function index(Request $request) {
        $pid = $request->input('q', 0);
        $areas = Area::getLocation($pid);
        $format = array_map(function ($k, $v) {
            return [
                'id'   => $k,
                'text' => $v,
            ];
        }, array_keys($areas), $areas);
        return response()->json($format);
    }


}
